﻿using Core.Caching;

namespace BCore.Identity.Users.Caching;

public static class UsersCacheKey
{
    public const string GetAllCacheKey = "all-users";

    public static string GetUserRolesCacheKey(string userId)
    {
        return $"UsersCacheKey:GetUserRolesQuery,{userId}";
    }
    public static string GetMineCacheKey(string userId)
    {
        return $"GetMineCacheKey:GetMineQuery,{userId}";
    }
    public static string GetPaginationCacheKey(string parameters)
    {
        return $"UsersCacheKey:UsersWithPaginationQuery,{parameters}";
    }

    public static IEnumerable<string>? Tags => new string[] { "user" };

    public static void Refresh()
    {
        CacheFactory.RemoveByTags(Tags);
    }
}
